﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Messaging;
using System.ServiceModel;

namespace Stores
{
    public class HostHelper
    {

        public static void Host() {

            string queue = ConfigurationManager.AppSettings["msmq"];

            if (!MessageQueue.Exists(queue))
                MessageQueue.Create(queue, true);

            ServiceHost host = new ServiceHost(typeof(Store));

            host.Open();
            Console.WriteLine("Serviço iniciado. Enter para terminar");
            Console.ReadLine();
            host.Close();
        
        }

    }
}
